import lazyLoadView from '@/router/lazy-load';
import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const DASHBOARD: AppRouteRecordRaw = {
  path: '/dashboard',
  name: 'dashboard',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.dashboard',
    requiresAuth: true,
    icon: 'icon-desktop',
    order: 0,
    roleCode: 'GROUP_WORKPLACE_ADMIN',
  },
  children: [
    {
      path: 'workplace',
      name: 'Workplace',
      component: lazyLoadView(
        () => import('@/views/dashboard/workplace/index.vue')
      ),
      meta: {
        locale: 'menu.dashboard.workplace',
        requiresAuth: true,
        roleCode: 'GROUP_OVERVIEW',
        layout: 'none',
      },
    },
    {
      path: 'medication-monitoring',
      name: 'MedicationMonitoring',
      component: lazyLoadView(
        () => import('@/views/dashboard/medication-monitoring/index.vue')
      ),
      meta: {
        pageName: '用药监控',
        locale: 'menu.dashboard.medicationMonitoring',
        requiresAuth: true,
        roleCode: 'GROUP_OVERVIEW',
        hideInMenu: true,
      },
    },
  ],
};

export default DASHBOARD;
